package com.eff.android.lib.asynctask;

import java.util.List;

import android.app.Activity;
import android.os.Bundle;
import android.os.SystemClock;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;

public class Example extends Activity {
   
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
			
		// vi du ve su dung api
		
		// lay du lieu va tao database
		AsyncTaskEF asyncTaskEF = new AsyncTaskEF(getApplicationContext());
		asyncTaskEF.execute();
		
		// Cho cpu nghi xiu
		SystemClock.sleep(2000);
		
		// Tao class su dung
		DatabaseHelper db = new DatabaseHelper(getApplicationContext());
		
		// goi ham tuong ung
		int n = 95;
		List<Model> listModel = db.getAllModels(n); 
		Log.d("Count ", String.valueOf(listModel.size()));
		for (int i = 0; i < listModel.size(); i++)
			Log.d("Get All Model with " + n + " Record ", listModel.get(i).getIdHinh() );
				
	}	
}
